<template>
    <el-button :type="type" :size="size" @click="onClick" :disabled="loading">
        <slot></slot>
        <i class="el-icon-loading" v-if="loading"></i>
    </el-button>
</template>

<script>
export default {
    name: "submit-button",
    data() {
        return {};
    },
    props: {
        loading: { type: Boolean, default: false },
        type: { type: String, default: "primary" },
        size: { type: String, default: "small" },
    },
    methods: {
        onClick: function() {
            event.preventDefault();
            this.$emit("click", null);
        }
    }
};
</script>
<style scoped>
.submit-button {
    display: inline-block;
}
</style>
